package com.meida.boot.handler;

import com.meida.common.mybatis.entity.EntityMap;
import com.meida.common.mybatis.interceptor.PageInterceptor;
import com.meida.common.mybatis.model.PageParams;
import com.meida.common.mybatis.model.ResultBody;
import com.meida.common.mybatis.query.CriteriaQuery;
import com.meida.common.security.OpenHelper;
import com.meida.module.user.client.entity.AppPosition;
import org.springframework.stereotype.Component;

/**
 * @author flyme
 * @date 2019/8/4 9:24
 * @desc 职位列表
 */
@Component("positionListHandler")
public class PositionListHandler implements PageInterceptor<AppPosition> {

    @Override
    public ResultBody validate(CriteriaQuery cq, EntityMap params) {
        return ResultBody.ok();
    }

    @Override
    public void prepare(CriteriaQuery cq, PageParams pageParams, EntityMap params) {
        Long companyId = OpenHelper.getCompanyId();
        cq.eq(AppPosition.class, "companyId", companyId);
    }



}
